package com.cqan.account.dao;


import java.util.List;

import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.cqan.account.entity.Department;
import com.cqan.dao.HibernateDao;

@Repository("departmentDao")
public class DepartmentDao extends HibernateDao<Department,Long> {

	@SuppressWarnings("unchecked")
	public List<Department> getDepartmentByPid(Long pid) {
		
		return getSession().createCriteria(Department.class).add(Restrictions.eq("parent.id", pid)).list();
	}
}
